package com.smart.seata.stock.service.impl;

import com.smart.seata.stock.mapper.StockMapper;
import com.smart.seata.stock.service.StockService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class StockServiceImpl implements StockService {
    @Resource
    StockMapper stockMapper;

    @Override
    public boolean decrStock(Long productId, Long quantity) {
        return stockMapper.updateQuantityByProductId(productId, quantity) > 0;
    }
}
